package zzr.library.db.obj;

import androidx.room.Entity;
import androidx.room.PrimaryKey;

import java.time.LocalDateTime;

@Entity(tableName = "borrow")
public class BorrowDO {

    @PrimaryKey(autoGenerate = true)
    public int oid;

    /**
     * 书
     */
    public int bId;

    /**
     * 借阅者
     */
    public int rid;

    /**
     * 借出时间
     */
    public LocalDateTime borrowTime;

    /**
     * 应还时间
     */
    public LocalDateTime dueTime;

    /**
     * 归还时间
     */
    public LocalDateTime returnTime;

    /**
     * 是否归还
     */
    public boolean returned;

    public BorrowDO(int oid, int bId, int rid, LocalDateTime borrowTime, LocalDateTime dueTime, LocalDateTime returnTime, boolean returned) {
        this.oid = oid;
        this.bId = bId;
        this.rid = rid;
        this.borrowTime = borrowTime;
        this.dueTime = dueTime;
        this.returnTime = returnTime;
        this.returned = returned;
    }
}
